# -*- coding:utf-8 -*-
# @author xupingmao <578749341@qq.com>
# @since 2019/12/01 14:27:01
# @modified 2019/12/01 16:26:35
import codecs
import sys
import time
import os
from bs4 import BeautifulSoup
from urllib.request import urlopen

BUFSIZE = 512 * 1024

def try_decode(bytes):
    exc = None
    for charset in ("utf-8", "gbk", "mbcs", "latin_1"):
        try:
            return codecs.decode(bytes, charset)
        except Exception as e:
            exc = e
    raise exc

def http_get(url, charset=None):
    """Http的GET请求"""
    out = []
    bufsize = BUFSIZE
    readsize = 0

    stream = urlopen(url)
    chunk = stream.read(bufsize)
    while chunk:
        out.append(chunk)
        readsize += len(chunk)
        chunk = stream.read(bufsize)
    print("get %s bytes" % readsize)
    bytes = b''.join(out)
    if charset:
        return codecs.decode(bytes, charset)
    else:
        return try_decode(bytes)

def download_by_curl(url):
    target = "temp-%s-%s.html" % (os.getpid(), time.time())
    os.system("curl '%s' > %s" % (url, target))
    with open(target, "r") as fp:
        html = fp.read()
    os.remove(target)
    return html

BASE64 = '''/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAEwAfQDAREAAhEBAxEB/8QAGwABAAIDAQEAAAAAAAAAAAAAAAMEAgUGAQf/xABLEAABAwICBAgNBAAEBQEJAAABAAIDBBEFEgYhMVETFBVBYZGS0iIzNFJVVnFyc5Ohs9E1NnSBIzJCsQdigsHwohYkQ0VGU4Ph8f/EABkBAQEBAQEBAAAAAAAAAAAAAAACAwEEBf/EADQRAQABAQMICwEAAgIDAAAAAAABAgMSExExQVFhcZHRITJCU2JyorGy4fAEIqGBwRQjUv/aAAwDAQACEQMRAD8A+7VlYKQRDgZJXyvyNYy172J5y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SqmAgICAgICAgICAgICAgICC1F4pvsQZoCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIOV0+/bp/kQfcCmvRvb2Hb8st7hn6dB7oVMEWJ+WYd8Z32nqas8ftEt7LqWm6PlSjra1lHG1zmlxcbABa0UTXLy11xTGVJTTtqYGytBAdzHmXKqZpnJLtNV6MsKLcTqGGvdUUsbYqNtyYZTI5/gB4s3KOY79vWpUxwfFpcT4wyalEEkDsrgJMwJOsW1biEGyjfnBOUixI23QZoCAgICAgICAgICC1F4pvsQZoCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIOV0+/bp/kQfcCmvRvb2Hb8st7hn6dB7oVMEWJ+WYd8Z32nqas8ftEt7LqWm6PlS9mp4qhgZKwOANx0K6appnLDz1UxVGSWUcbIoxGxoa0CwASZmZyyRERGSFOLCKWJ8zg+pdwwIkElS94fduXWCd2pcdT09FTUpkdBC**Dd7gNbtVtZ28yCVjGxtysFgOZBkgICAgICAgICAgILUXim+xBmgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg5XT79un+RB9wKa9G9vYdvyy3uGfp0HuhUwRYn5Zh3xnfaepqzx+0S3supabo+VLN8jI25nva1u9xsriJnMxiJnoh6HAtzAgi17hccUYMbwqplfFT4hTzSMF3MjdmcB0ga0BuOYU5krm4jTFsMohkPCABrybBp6boMnYvhrIeGfX0zY+F4HM6UAZ72y+2/8A5ZBZiningZPFI18TwHNeDqIKDMEG9iDbUbHYg9QEBAQEBAQEBBai8U32IM0BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEHK6fft0/yIPuBTXo3t7Dt+WW9wz9Og90KmCLE/LMO+M77T1NWeP2iW9l1LTdHypQYjROrY2Brw1zTfXsK2s7S5KbK0uTOVLSQGlpWRZsxaNvSprqvVZU11XqpqcrhmhLqGatl4aNr6qGVmZji7KXHVfwRewA2FusdKlDN+iNYaSePj0D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Jb2XUtN0fKlDXyTxxNMN9vhFouQqYM4XTOosz/BlyG19Wu2ooOKpJdJRBIx89dws0EpY5xa4AtYbaiLtNy0g7Dm9gQbnRqTFTVztrqiaWB0QfG2Rouwl28AHX4VgeYdYdIgICAgICAgICAgICC1F4pvsQZoCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIOV0+/bp/kQfcCmvRvb2Hb8st7hn6dB7oVMEWJ+WYd8Z32nqas8ftEt7LqWm6PlSlVMBAud5QLnegICAgICAgICAgICAgtReKb7EGaAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDldPv26f5EH3Apr0b29h2/LLe4Z+nQe6FTBFiflmHfGd9p6mrPH7RLey6lpuj5UpVTBiyRkheGPa4sdldY/5TuPTrC5ExLs0zGTLpQVNfT0ZYJnlpe7KBbnXKq4pztLOxrtMt2HvHqThXRcYiEgeIy3ML5iLgfVL9OXJlcwbTJeydGdE3FaN8hY2Q6mcISWkDLa99+wLmJTlXP8APaRGWY05E8FXBUuc2J+YtAJBaRYHZtHQV2KonMzrs6qOmqEypAgICAgICAgICC1F4pvsQZoCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIOV0+/bp/kQfcCmvRvb2Hb8st7hn6dB7oVMEWJ+WYd8Z32nqas8ftEt7HqWm6PlSkcA5paTqItqNlTGOhQw7CYsOlqJGSyvM0hcA+V7rAgatZNzq27VnRZxRMy9Fv/AE1W0UxMR0Rqj/qP9MqygNU8OE4ZrF/ADtVrHbv/AOy7VRe0psra5GTJlRS4W+StbUioa0hwJGS9xq1bf+UfVTNnlnLlXT/REUXMn7p5vDg7Mr2iY+E1zRcXtdpbf260w9p/5U5YnJq98qahw/iUsr+FD87WttltaxPSd6qii7OVFtbYkRGTMvK2AgICAgICAgICC1F4pvsQZoCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIOV0+/bp/kQfcCirRvb2Hb8st7hn6dB7oVsGOK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fwU8Ps5E0o9YajsM7qXNsmP4KeH2ciaUesNR2Gd1Lm2TH8FPD7ORNKPWGo7DO6lzbJj+Cnh9nImlHrDUdhndS5tkx/BTw+zkTSj1hqOwzupc2yY/gp4fZyJpR6w1HYZ3UubZMfwU8Ps5E0o9YajsM7qXNsmP4KeH2ciaUesNR2Gd1Lm2TH8FPD7ORNKPWGo7DO6lzbJj+Cnh9nImlHrDUdhndS5tkx/BTw+zkTSj1hqOwzupc2yY/gp4fZyJpR6w1HYZ3UubZMfwU8Ps5E0o9YajsM7qXNsmP4KeH2ciaUesNR2Gd1Lm2TH8FPD7ORNKPWGo7DO6lzbJj+Cnh9nImlHrDUdhndS5tkx/BTw+0c2jGN1wbFX4xNUQB7XmNzWgEg3GwDnS5tJ/onJMRTEZejoj7djTQcBTsiv/AJRZWwf/2Q=='''


def main(argc, argv):
    url = argv[1]
    html = download_by_curl(url)
    # print(html)
    soup = BeautifulSoup(html, 'html.parser')
    imgs = soup.find_all("img")
    for img in imgs:
        # print(img)
        src = img.attrs.get('src')
        # print(src)
        img.attrs['src'] = 'data:image/jpeg;base64,' + BASE64;
        # print(img)

    # print(soup.prettify())
    with open("target.html", "w+") as fp:
        fp.write(soup.prettify())

if __name__ == '__main__':
    main(len(sys.argv), sys.argv)

